package cn.wolfcode.enums;

import lombok.Getter;

/**
 * 预约单枚举类
 */
@Getter
public enum BusinessReportEnum {
    BUSINESS("门店","b.name"),
    YEAR("年","DATE_FORMAT(c.create_time,'%Y')"),
    MONTH("月","DATE_FORMAT(c.create_time,'%Y-%m')"),
    DAY("日","DATE_FORMAT(c.create_time,'%Y-%m-%d')");

    private String name;
    private String value;
    BusinessReportEnum(String name, String value){
        this.name = name;
        this.value = value;
    }
    //传入value来找到name
    public static String findName(Integer value){
        BusinessReportEnum[] enums = BusinessReportEnum.values();
        for (BusinessReportEnum anEnum : enums) {
            if (anEnum.getValue().equals(value)) {
                return anEnum.getName();
            }
        }
        return null;
    }
}
